<!DOCTYPE html>
<html>
  <head>
    <title>Drawing tools</title>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta charset="utf-8">
    <style>
      html, body, #map-canvas {
        height: 100%;
        margin: 0px;
        padding: 0px
      }
    </style>
    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=drawing"></script>
    <script>
        function initialize() {
            var shangHai = new google.maps.LatLng(33.774546, 121.433523);

            map = new google.maps.Map(document.getElementById('map-canvas'), {
                center: shangHai,
                zoom: 4,
                 mapTypeId: google.maps.MapTypeId.ROADMAP,
                //mapTypeId: google.maps.MapTypeId.SATELLITE
            });

var goldStar = {
  path: 'M 125,5 155,90 245,90 175,145 200,230 125,180 50,230 75,145 5,90 95,90 z',
  fillColor: "red",
  fillOpacity: 0.8,
  scale: 1,
  strokeColor: "gold",
  strokeWeight: 14
};

            var marker = new google.maps.Marker({
    position: shangHai,
     icon: goldStar,
    title:"Hello World!"

});

// To add the marker to the map, call setMap();
marker.setMap(map);


  var flightPlanCoordinates = [
    new google.maps.LatLng(40, 110),
    new google.maps.LatLng(33, 115),
    new google.maps.LatLng(32, 118),
    new google.maps.LatLng(31, 116),
    new google.maps.LatLng(29, 114),   
  ];
  var flightPath = new google.maps.Polyline({
    path: flightPlanCoordinates,
    strokeColor: "#FF0000",
    strokeOpacity: 2.0,
    strokeWeight: 5
  });

  flightPath.setMap(map);


  var flightPlanCoordinates2 = [
       new google.maps.LatLng(29, 114),   
    new google.maps.LatLng(27, 120),
    new google.maps.LatLng(26, 125),
    new google.maps.LatLng(25, 115),
    new google.maps.LatLng(24, 115),  
     new google.maps.LatLng(40, 110) 
  ];
   var flightPath = new google.maps.Polyline({
    path: flightPlanCoordinates2,
    strokeColor: "#FFFF00",
    strokeOpacity: 2.0,
    strokeWeight: 5
  });

  flightPath.setMap(map);

//            var heatmapData = [
//  new google.maps.LatLng(37.782, -122.447),
//  new google.maps.LatLng(37.782, -122.445),
//  new google.maps.LatLng(37.782, -122.443),
//  new google.maps.LatLng(37.782, -122.441),
//  new google.maps.LatLng(37.782, -122.439),
//  new google.maps.LatLng(37.782, -122.437),
//  new google.maps.LatLng(37.782, -122.435),
//  new google.maps.LatLng(37.785, -122.447),
//  new google.maps.LatLng(37.785, -122.445),
//  new google.maps.LatLng(37.785, -122.443),
//  new google.maps.LatLng(37.785, -122.441),
//  new google.maps.LatLng(37.785, -122.439),
//  new google.maps.LatLng(37.785, -122.437),
//  new google.maps.LatLng(37.785, -122.435)
//];

//            var heatmap = new google.maps.visualization.HeatmapLayer({
//                data: heatmapData
//            });

//            heatmap.setMap(map);

            var drawingManager = new google.maps.drawing.DrawingManager({
                drawingMode: google.maps.drawing.OverlayType.MARKER,
                drawingControl: true,
                drawingControlOptions: {
                    position: google.maps.ControlPosition.TOP_CENTER,
                    drawingModes: [
        google.maps.drawing.OverlayType.MARKER,
        google.maps.drawing.OverlayType.CIRCLE,
        google.maps.drawing.OverlayType.POLYGON,
        google.maps.drawing.OverlayType.POLYLINE,
        google.maps.drawing.OverlayType.RECTANGLE
      ]
                },
                markerOptions: {
                    icon: 'images/beachflag.png'
                },
                circleOptions: {
                    fillColor: '#ffff00',
                    fillOpacity: 1,
                    strokeWeight: 5,
                    clickable: false,
                    editable: true,
                    zIndex: 1
                }
            });
            drawingManager.setMap(map);
        }

        google.maps.event.addDomListener(window, 'load', initialize);

    </script>
  </head>
  <body>
    <div id="map-canvas"></div>
  </body>
</html>